<include file="Public:header" />
<include file="Public:left" />

<style>
td,th{text-align:center;}
h2{line-height: 42px;}
</style>
<section>
	<div class="page_title">
	<h2 class="fl">公告列表</h2>
	<a class="fr" href="{:url('notice/add')}">添加公告</a>
	</div>
	<table class="table">
		<tr>
		<th>公告编号</th>
		<th>公告图片</th>
        <th>排序</th>
        <th>状态</th>
		<th>操作</th>
		</tr>
		<volist name="data" id="vo">
		<tr>
		<td>{$vo['id']}</td>
		<td><img src="__STATIC__/uploads/{$vo.image}" style="height: 60px;"></td>
        <td>{$vo.sort}</td>
        <td>
            <switch name="$vo.status">
                <case value="0">已禁用</case>
                <case value="1">已启用</case>
            </switch>
        </td>
		<td>
			<a href="{:url('notice/edit',array('id'=>$vo['id']))}" class="inner_btn">详情</a>
			<a href="{:url('notice/ban',array('id'=>$vo['id']))}" class="inner_btn"><eq name="vo.status" value="0">启用<else/>禁用</eq></a>
			<a onclick="return confirm('确认删除？')" href="{:url('notice/del',array('id'=>$vo['id']))}"  class="inner_btn" >删除</a>
		</td>
		</tr>
		</volist>
	</table>
	{$data->render()}
</section>

	<script>
	$(document).ready(function(){
		$(".admin_tab li a").click(function(){
		var liindex = $(".admin_tab li a").index(this);
		$(this).addClass("active").parent().siblings().find("a").removeClass("active");
		$(".admin_tab_cont").eq(liindex).fadeIn(150).siblings(".admin_tab_cont").hide();
		});
		});
	</script>
</body>
</html>
